package com.taikang.base.view;

import java.io.PrintWriter;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.view.AbstractView;

import com.taikang.base.json.JsonBuilder;

public class CustomJsonView extends AbstractView{

	@Override
	protected void renderMergedOutputModel(Map<String, Object> model,HttpServletRequest request, HttpServletResponse response) throws Exception {
		JsonBuilder jb = new JsonBuilder();
		jb.setExcludeFields("class","className");//排除的Bean属性
		response.setContentType("text/json;charset=UTF-8");
		PrintWriter out = response.getWriter();
		
		out.print(jb.encode(model));
		
	}

}
